package com.imooc.job;


import cn.hutool.core.date.DateUtil;
import lombok.Getter;
import lombok.Setter;
import org.quartz.*;

@DisallowConcurrentExecution
@PersistJobDataAfterExecution
public class MyJob implements Job {
    @Setter
    @Getter
    private String name;
    @Setter
    @Getter
    private Integer count;

    public void execute(JobExecutionContext context) throws JobExecutionException {
        String now = DateUtil.now();
        count++;
        context.getJobDetail().getJobDataMap().put("count", count);
        System.out.println("hello!!!!" + name + "我正在执行：" + now+"=====》"+count);
    }
}
